// app\service\serviceRegister.js
'use strict';

const Service = require('egg').Service;

class ServiceLoginService extends Service {
    async postLoginData(data) {
        const result = await this.app.mysql.get('user'
            , {
                username: data.username,
                password: data.password
            }
        )
        if (result) {
            return { code: 1, username: result.username }

        } else {
            return { code: 0, message: "用户名或密码错误" }

        }

    }
}

module.exports = ServiceLoginService;
